package com.atguigu.gmall.order.client;
import com.atguigu.gmall.order.client.impl.OrderDegradeFeignClient;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.model.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

@FeignClient(value = "service-order", fallback = OrderDegradeFeignClient.class)
public interface OrderFeignClient {

    /**
     * 汇总订单确认页面需要的数据
     * @param
     * @return
     */
    @GetMapping("/api/order/auth/trade")
    public Result<Map> OrderTrade();

    /**
     * 根据orderId查询订单信息,包含订单明细
     * @param orderId
     * @return
     */
    @GetMapping("/api/order/inner/getOrderInfo/{orderId}")
    public OrderInfo getOrderInfoByOrderId(@PathVariable("orderId") Long orderId);
}